#!/usr/bin/env python3

import rclpy
from rclpy.node import Node
from manipulation.msg import ManiProcessCmd
import time

def main(node: Node):
    pub = node.create_publisher(ManiProcessCmd, 'mani_process', 1)
    while True:
        msg = ManiProcessCmd()
        msg.level1_name = "abc"
        msg.level2_name = "def"
        msg.value = 123.456
        pub.publish(msg)
        node.get_logger().info(f"Published: {msg}")
        time.sleep(0.1)

if __name__ == '__main__':
    rclpy.init()
    node = rclpy.create_node('customed_msg_test')
    try:
        main(node)
        rclpy.spin(node)
    except:
        node.destroy_node()
        rclpy.shutdown()
